﻿using System;
using FlatRedBall.Input;

namespace Rvz.Game.Main.Inputs
{
    public class RationalizedGamePadInput : IRationalizedInputDevice
    {
        private readonly Xbox360GamePad _gamePad;
        private readonly float _sensitivityAdjustment;

        public RationalizedGamePadInput(Xbox360GamePad gamePad, float sensitivityAdjustment)
        {
            _gamePad = gamePad;
            _sensitivityAdjustment = sensitivityAdjustment;
        }

        public float MoveX
        {
            get { return _gamePad.LeftStick.Position.X; }
        }

        public float MoveY
        {
            get { return _gamePad.LeftStick.Position.Y; }
        }

        public float TurnX
        {
            get { return _gamePad.RightStick.Position.X * _sensitivityAdjustment; }
        }

        public float TurnY
        {
            get { return _gamePad.RightStick.Position.Y * _sensitivityAdjustment; }
        }

        public int TurnSensitivity
        {
            get { return 1; }
        }

        public float FireTrigger
        {
            get { return _gamePad.RightTrigger.Position; }
        }
    }
}